# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=blackarch-devtools-toolkit
_pkgname=${pkgname%-toolkit}
pkgver=0.3.0.r7.ge393678
pkgrel=1
epoch=1
pkgdesc='Development framework for the BlackArch Linux distribution written in Rust.'
arch=('x86_64' 'aarch64')
url='https://github.com/Edu4rdSHL/blackarch-devtools'
license=('GPL-3.0-or-later')
depends=('btrfs-progs' 'devtools')
makedepends=('cargo' 'git')
source=("git+https://github.com/Edu4rdSHL/$_pkgname.git")
sha512sums=('SKIP')

pkgver() {
  cd $_pkgname

  ( set -o pipefail
    git describe --long --tags --abbrev=7 2>/dev/null |
      sed 's/\([^-]*-g\)/r\1/;s/-/./g' ||
    printf "%s.%s" "$(git rev-list --count HEAD)" \
      "$(git rev-parse --short=7 HEAD)"
  )
}

build() {
  cd $_pkgname

  cargo build --release
}

package() {
  cd $_pkgname

  install -Dm 755 "target/release/$_pkgname" "$pkgdir/usr/bin/ba-dev"
}

